package com.dudu.utils;

import com.dudu.enumeration.H5CodeDefinition;
import com.dudu.model.CheckResult;

import net.sf.json.JSONObject;

public class H5CheckUtils {
	
	public static CheckResult createResult(H5CodeDefinition code,boolean through) {
		return new CheckResult(through,transformCodeDefinition(code));
	}
	
	public static JSONObject transformCodeDefinition(H5CodeDefinition code){
		JSONObject jo = new JSONObject();
		jo.put("code", code.getCode());
		jo.put("describe", code.getMessage());
		return jo;
	}
	
	public static JSONObject transformCodeDefinition(String code,String describe){
		JSONObject jo = new JSONObject();
		jo.put("code", code);
		jo.put("describe", describe);
		return jo;
	}

}
